// 简化版打卡系统API接口
import request from '../util/request';

// 打卡活动相关API（简化版，移除子打卡概念）
export const getCheckinActivitiesApi = (data) => {
  return request({
    url: `${process.env.PUBLIC_URL}/checkin/getCheckinActivities`,
    method: 'post',
    data,
  });
};

export const getCheckinActivityDetailApi = (data) => {
  return request({
    url: `${process.env.PUBLIC_URL}/checkin/getCheckinActivityDetail`,
    method: 'post',
    data,
  });
};

export const createCheckinActivityApi = (data) => {
  return request({
    url: `${process.env.PUBLIC_URL}/checkin/createCheckinActivity`,
    method: 'post',
    data,
  });
};

export const updateCheckinActivityApi = (data) => {
  return request({
    url: `${process.env.PUBLIC_URL}/checkin/updateCheckinActivity`,
    method: 'post',
    data,
  });
};

export const deleteCheckinActivityApi = (data) => {
  return request({
    url: `${process.env.PUBLIC_URL}/checkin/deleteCheckinActivity`,
    method: 'post',
    data,
  });
};

// 打卡记录相关API（简化版）
export const getCheckinRecordsApi = (data) => {
  return request({
    url: `${process.env.PUBLIC_URL}/checkin/getCheckinRecords`,
    method: 'post',
    data,
  });
};

export const createCheckinRecordApi = (data) => {
  return request({
    url: `${process.env.PUBLIC_URL}/checkin/createCheckinRecord`,
    method: 'post',
    data,
  });
};

export const updateCheckinRecordApi = (data) => {
  return request({
    url: `${process.env.PUBLIC_URL}/checkin/updateCheckinRecord`,
    method: 'post',
    data,
  });
};

export const deleteCheckinRecordApi = (data) => {
  return request({
    url: `${process.env.PUBLIC_URL}/checkin/deleteCheckinRecord`,
    method: 'post',
    data,
  });
};

// 参与者管理相关API
export const addParticipantsApi = (data) => {
  return request({
    url: `${process.env.PUBLIC_URL}/checkin/addParticipants`,
    method: 'post',
    data,
  });
};

export const removeParticipantApi = (data) => {
  return request({
    url: `${process.env.PUBLIC_URL}/checkin/removeParticipant`,
    method: 'post',
    data,
  });
};

export const getParticipantsApi = (data) => {
  return request({
    url: `${process.env.PUBLIC_URL}/checkin/getParticipants`,
    method: 'post',
    data,
  });
};

// 统计相关API
export const getCheckinStatsApi = (data) => {
  return request({
    url: `${process.env.PUBLIC_URL}/checkin/getCheckinStats`,
    method: 'post',
    data,
  });
};

// 日历相关API
export const getCheckinCalendarApi = (data) => {
  return request({
    url: `${process.env.PUBLIC_URL}/checkin/getCheckinCalendar`,
    method: 'post',
    data,
  });
};

// 活动参与相关API
export const joinActivityApi = (data) => {
  return request({
    url: `${process.env.PUBLIC_URL}/checkin/joinActivity`,
    method: 'post',
    data,
  });
};

export const leaveActivityApi = (data) => {
  return request({
    url: `${process.env.PUBLIC_URL}/checkin/leaveActivity`,
    method: 'post',
    data,
  });
};

// 导出相关API
export const exportCheckinDataApi = (data) => {
  return request({
    url: `${process.env.PUBLIC_URL}/checkin/exportCheckinData`,
    method: 'post',
    data,
    responseType: 'blob',
  });
}; 